import Login from './views/Login.vue'
import NotFound from './views/404.vue'
import Home from './views/Home.vue'
//1
import i18n from './common/i18n/index'
//2
import Vue from 'vue'
var i18nlang = new Vue({i18n})


// 用户管理
import userlist from './views/homeUser/userlist.vue'
import userstatistics from './views/homeUser/userstatistics.vue'

import personaluserlist from './views/homeUser/personaluserlist.vue'

import approved from './views/homeUser/approved.vue'
import auditfailed from './views/homeUser/auditfailed.vue'
import tobereviewed from './views/homeUser/tobereviewed.vue'
import exchange from './views/homeUser/exchange.vue'
import deposit from './views/homeUser/deposit.vue'
import withdraw from './views/homeUser/withdraw.vue'
import newopenuser from './views/homeUser/newopenuser.vue'
import recPlan from './views/homeUser/recPlan.vue'

// 交易钱包
import tradewallet from './views/dealmoney/tradewallet.vue'
import withdrawconfig from './views/dealmoney/withdrawconfig.vue'

// 风控管理
import dayend from './views/riskcontrol/dayend.vue'
import userwallet from './views/riskcontrol/userwallet.vue'
import userposition from './views/riskcontrol/userposition.vue'
import realtimesummary from './views/riskcontrol/realtimesummary.vue'


import stakinglist from './views/pledge/stakinglist.vue'
import userInterestList from './views/pledge/userInterestList.vue'
import dividendsummary from './views/pledge/dividendsummary.vue'

import userransomstakinglist from './views/pledge/userransomstakinglist.vue'
import userstakinghistorylist from './views/pledge/userstakinghistorylist.vue'
import userstakinglist from './views/pledge/userstakinglist.vue'

import binance from './views/getBinanceCoinInfo/binance.vue'
import realtimeprice from './views/getBinanceCoinInfo/realtimeprice.vue'




import Page5 from './views/dealmoney/Page5.vue'



let routes = [
    {
        path: '/login',
        component: Login,
        name: '',
    },
    {
        path: '/404',
        component: NotFound,
        name: '',
        pathName:'/404',
    },
    
    {
        path: '/',
        component: Home,
        redirect:'/userstatistics',
        pathName:'userlist',
        // name:i18n.messages[i18n.locale].router.usermanagement,
        name:i18nlang.$t('router.usercontrol'),
        leaf:false,
        iconCls: 'el-icon-s-custom',
        children: [
            { path: '/userstatistics',component: userstatistics, name: i18nlang.$t('router.userstatistics'),hidden:false},
            { path: '/userlist',component: userlist, name: i18nlang.$t('router.userlist'),hidden:false},
            { path: '/personaluserlist',component: personaluserlist, name: i18nlang.$t('router.personaluserlist'),hidden:false},
            { path: '/approved', component: approved, name:  i18nlang.$t('router.approved'),hidden:false},
            { path: '/auditfailed', component: auditfailed, name:  i18nlang.$t('router.auditfailed'),hidden:false},
            { path: '/tobereviewed', component: tobereviewed, name:  i18nlang.$t('router.tobereviewed'),hidden:false},
            { path: '/exchange', component: exchange, name:i18nlang.$t('router.userexchange'),hidden:false},
            { path: '/deposit', component: deposit, name:i18nlang.$t('router.userdeposit'),hidden:false},
            { path: '/withdraw', component: withdraw, name:i18nlang.$t('router.userwitdraw'),hidden:false},
            { path: '/newopenuser', component: newopenuser, name: i18nlang.$t('router.usernewopenuser'),hidden:false},
            { path: '/recPlan', component: recPlan, name: i18nlang.$t('router.userrecplan'),hidden:false},
        ]
    },

 

    {
        path: '/',
        component: Home,
        name: i18nlang.$t('router.tradeWallet'),
        leaf:false,
        pathName:'tradewallet',
        iconCls: 'fa fa-id-card-o',
        children: [
            { path: '/tradewallet', component: tradewallet, name: i18nlang.$t('router.tradewalletlist'),hidden:false },
            { path: '/withdrawconfig', component: withdrawconfig, name: i18nlang.$t('router.withdrawconfig'),hidden:false },
        ]
    },
    {
        path: '/',
        component: Home,
        name: i18nlang.$t('router.riskcontrol'),
        leaf:false,
        pathName:'userwallet',
        iconCls: 'el-icon-s-data',
        children: [
        { path: '/userwallet',component:userwallet, name: i18nlang.$t('router.userwallet'),hidden:false},
        { path: '/dayend', component: dayend, name:  i18nlang.$t('router.dayend'),hidden:false},
        { path: '/userposition', component: userposition, name: i18nlang.$t('router.userposition'),hidden:false},
        { path: '/realtimesummary', component: realtimesummary, name:  i18nlang.$t('router.summary'),hidden:false},
        
    ] 
    },

    {
        path: '/',
        component: Home,
        name: i18nlang.$t('router.management'),
        leaf:false,
        pathName:'stakinglist',
        iconCls: 'el-icon-set-up',
        children: [
            { path: '/stakinglist', component: stakinglist, name: i18nlang.$t('router.stakinglist'),hidden:false },
            { path: '/userinterestlist', component: userInterestList, name:i18nlang.$t('router.userinterestlist') ,hidden:false },
            { path: '/dividendsummary', component: dividendsummary, name:i18nlang.$t('router.dividendsummary') ,hidden:false },
           
            { path: '/userransomstakinglist', component: userransomstakinglist, name:i18nlang.$t('router.userransomstakinglist') ,hidden:false },
            { path: '/userstakinghistorylist', component: userstakinghistorylist, name:i18nlang.$t('router.userstakinghistorylist') ,hidden:false },
            { path: '/userstakinglist', component: userstakinglist, name:i18nlang.$t('router.userstakinglist') ,hidden:false }
        ]
    },


    {
        path: '/',
        component: Home,
        name:  i18nlang.$t('router.tripartitedata'),
        leaf:false,
        pathName:'getBinanceCoinInfo',
        iconCls: 'el-icon-coin',
        children: [
            { path: '/binance', component: binance, name:i18nlang.$t('router.securitydata'), hidden:false },   
            { path: '/realtimeprice', component: realtimeprice, name:i18nlang.$t('router.realtimeprice'), hidden:false },   
        ]
    },
    
    {
        path: '*',
        leaf: false,
        redirect: { path: '/404' }
    }
];
// console.log(i18nlang.$t('router.usermanagement'))
// routes[2]['name'] = i18nlang.$t('router.usermanagement')

// let jurisdiction = {'Admin':
//               ['userlist','/userlist','/exchange','/deposit','/withdraw','/newpenuser',
//                'tradewallet','/tradewallet','/withdrawconfig',
//                'userwallet','/userwallet','/dayend','/userposition',
//                ],
//                'Dealing': 
//                ['userlist','/userlist','/exchange','/deposit','/withdraw','/newopenuser',
//                'tradewallet','/tradewallet','/withdrawconfig',
//                'userwallet','/userwallet','/dayend','/userposition',
//                ],
//                'Compliance': 
//                ['userlist','/userlist','/exchange','/deposit','/withdraw','/newopenuser',
//                'tradewallet','/tradewallet','/withdrawconfig',
//                'userwallet','/userwallet','/dayend','/userposition',
//                ],

//                'CS': 
//                ['userlist','/userlist','/exchange','/deposit','/withdraw','/newopenuser',
               
               
//                ],

//                'Counter': 
//                ['userlist','/userlist'
//                ],
// }



// let boxToken = sessionStorage.getItem('boxToken')
// if (boxToken) {
//     let diction = sessionStorage.getItem("bospower");
//     console.log(diction)
// routes.forEach(function(item){
//     if(item.pathName){
//         if(jurisdiction[diction].indexOf(item.pathName)>=0){
//             item.leaf = true;
//         }
//         if(item.children){
//             item.children.forEach(function(item){
//                 if(jurisdiction[diction].indexOf(item.path)>=0){
//                     item.hidden = true;
//                 }
//             })
//         }
//     }
// })
// }



export default routes;